﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace TS2015
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{glimpse}.axd/{*pathInfo}");
            routes.IgnoreRoute("OrcService/{myWebServices}.asmx/{*pathInfo}");
            routes.MapMvcAttributeRoutes();
  
            routes.MapRoute(
                "Default",
                 "{controller}/{action}/{id}",
                 new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                new string[] { "TS2015.Controllers" }
            );

            routes.MapRoute(
                "Admin",
                "Admin/{controller}/{action}/{id}",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                new string[] { "TS2015.Areas.Admin.Controllers" }
            );

            routes.MapRoute(
             "ChiTiet",
             "tin-tuc/{seoName}-#{id}",
             new { controller = "Common", action = "ChiTiet", seoName = ""},
             new { id = @"^\d+$" }
            );            
        }
    }
}